<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: infobox.php 502 2014-01-31 15:50:06Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 502 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2014-01-31 15:50:06 +0000 (Fri, 31 Jan 2014) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

$box_smarty = new Smarty();

if(!CacheCheck()) {
	$cache = true;
	$box_smarty->caching = false;

} else {
	$cache = true;
	$box_smarty->caching = true;
	$box_smarty->cache_lifetime = CACHE_LIFETIME;
	$box_smarty->cache_modified_check = CACHE_CHECK;
	$cache_id = 'box_infobox_'.$_SESSION['language']-'_'.$_SESSION['customers_status']['customers_status_id'].'_';
}

if(!$box_smarty->isCached(CURRENT_TEMPLATE.'/boxes/box_infobox.html', $cache_id) || !$cache){
	$box_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
	$box_smarty->assign('html_tpl_path', CURRENT_TEMPLATE.'/html');

	if($_SESSION['customers_status']['customers_status_image']!='')
		$loginboxcontent = '<img src="'.DIR_WS_CATALOG.'admin/images/icons/'.$_SESSION['customers_status']['customers_status_image'].'" alt="'.$_SESSION['customers_status']['customers_status_name'].'" /><br />';

	$loginboxcontent .= BOX_LOGINBOX_STATUS.' <b>'.$_SESSION['customers_status']['customers_status_name'].'</b><br />';

	if($_SESSION['customers_status']['customers_status_show_price'] == 0)
		$loginboxcontent .= NOT_ALLOWED_TO_SEE_PRICES_TEXT;

	else  {
		if($_SESSION['customers_status']['customers_status_discount'] != '0.00')
			$loginboxcontent.= BOX_LOGINBOX_DISCOUNT.' '.$_SESSION['customers_status']['customers_status_discount'].'%<br />';

		if($_SESSION['customers_status']['customers_status_ot_discount_flag'] == 1  && $_SESSION['customers_status']['customers_status_ot_discount'] != '0.00')
			$loginboxcontent .= BOX_LOGINBOX_DISCOUNT_TEXT.' ' .$_SESSION['customers_status']['customers_status_ot_discount'].'% '.BOX_LOGINBOX_DISCOUNT_OT.'<br />';
	}

	$box_smarty->assign('BOX_CONTENT', $loginboxcontent);
	$box_smarty->assign('language', $_SESSION['language']);
}

if(!$cache)
	$box_content = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_infobox.html');
else
	$box_content = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_infobox.html', $cache_id);